/* GUI CONVERTED from reworp03.p (converter v1.76) Mon Sep 17 22:18:38 2001 */
/* reworp03.p - REPETITIVE                                                    */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.6.1.5 $                                                       */
/*V8:ConvertMode=FullGUIReport                                                */
/* REVISION: 7.3               LAST MODIFIED: 10/31/94   BY: WUG *GN77*       */
/* REVISION: 8.6               LAST MODIFIED: 10/15/97   BY: GYK *K10Z*       */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane          */
/* REVISION: 8.6E     LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan         */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan         */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane   */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* myb                */
/* REVISION: 9.1      LAST MODIFIED: 09/11/00   BY: *N0RQ* Mudit Mehta        */
/* Old ECO marker removed, but no ECO header exists *F0PN*                    */
/* Revision: 1.6.1.4     BY: Katie Hilbert   DATE: 04/08/01  ECO: *P008*      */
/* $Revision: 1.6.1.5 $    BY: Manjusha Inglay  DATE: 08/28/01  ECO: *P01R*   */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/


/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

{mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE reworp03_p_1 "Report Cost Elements"
/* MaxLen: Comment: */

&SCOPED-DEFINE reworp03_p_3 "Effective"
/* MaxLen: Comment: */

&SCOPED-DEFINE reworp03_p_5 "Cost Set To Use"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

/* WIP VALUATION REPORT                                                       */

define new shared variable lot   like wo_lot.
define new shared variable lot1  like wo_lot label {t001.i}.
define new shared variable part  like wo_part.
define new shared variable part1 like wo_part label {t001.i}.
define new shared variable site  like wo_site.
define new shared variable site1 like wo_site label {t001.i}.
define new shared variable line  like wo_line.
define new shared variable line1 like wo_line label {t001.i}.
define new shared variable endeff as date label {&reworp03_p_3}.
define new shared variable cost_set_to_use as character format "x"
   label {&reworp03_p_5}.
define new shared variable report_cost_elements like mfc_logical
   label {&reworp03_p_1}.

define variable disp-cum-order-standard as character no-undo
   format "x(34)".
define variable disp-cum-order-average  as character no-undo
   format "x(34)".
define variable disp-gl-cost            as character no-undo
   format "x(34)".

disp-cum-order-standard = "1 - " + getTermLabel("CUM_ORDER_STANDARD",30).
disp-cum-order-average =  "2 - " + getTermLabel("CUM_ORDER_AVERAGE",30).
disp-gl-cost =            "3 - " + getTermLabel("GL_COST",30).


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
lot                      colon 20
   lot1                     colon 45
   part                     colon 20
   part1                    colon 45
   site                     colon 20
   site1                    colon 45
   line                     colon 20
   line1                    colon 45
   skip(1)
   endeff                   colon 35
   report_cost_elements     colon 35
   cost_set_to_use          colon 35
   disp-cum-order-standard  at 40 no-label
   disp-cum-order-average   at 40 no-label
   disp-gl-cost             at 40 no-label
 SKIP(.4)  /*GUI*/
with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

assign
   endeff = today
   cost_set_to_use = "1".

{wbrp01.i}


/*GUI*/ {mfguirpa.i true "printer" 132 " " " " " "  }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:


   if lot1 = hi_char then lot1 = "".
   if part1 = hi_char then part1 = "".
   if site1 = hi_char then site1 = "".
   if line1 = hi_char then line1 = "".

   if c-application-mode <> 'web' then
   display
      disp-cum-order-standard
      disp-cum-order-average
      disp-gl-cost
   with frame a.

   if c-application-mode <> 'web' then
   
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


   {wbrp06.i &command = update
      &fields = "  lot lot1 part part1 site site1
                   line line1 endeff report_cost_elements
                   cost_set_to_use"
      &frm = "a"}

   if (c-application-mode <> 'web') or
      (c-application-mode = 'web' and
      (c-web-request begins 'data'))
   then do:

      if endeff = ? then do:
         {pxmsg.i &MSGNUM=27 &ERRORLEVEL=3}
         if c-application-mode = 'web' then return.
         else /*GUI NEXT-PROMPT removed */
         /*GUI UNDO removed */ RETURN ERROR.
      end.

      bcdparm = "".
      {mfquoter.i lot           }
      {mfquoter.i lot1          }
      {mfquoter.i part          }
      {mfquoter.i part1         }
      {mfquoter.i site          }
      {mfquoter.i site1         }
      {mfquoter.i line          }
      {mfquoter.i line1         }
      {mfquoter.i endeff              }
      {mfquoter.i report_cost_elements}
      {mfquoter.i cost_set_to_use     }

      if lot1 = "" then lot1 = hi_char.
      if part1 = "" then part1 = hi_char.
      if site1 = "" then site1 = hi_char.
      if line1 = "" then line1 = hi_char.

   end.

   /* OUTPUT DESTINATION SELECTION */
   
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i "printer" 132 " " " " " " " " }
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:




   {gprun.i ""reworp3a.p""}

   
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/


end.

{wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" lot lot1 part part1 site site1 line line1 endeff report_cost_elements cost_set_to_use "} /*Drive the Report*/
